package com.imooc.spark

import org.apache.spark.sql.SQLContext
import org.apache.spark.sql.hive.HiveContext
import org.apache.spark.{SparkConf, SparkContext}

object HiveContextApp {
  def main(args: Array[String]): Unit = {
    //1) 创建相应的Context
    val sparkConf = new SparkConf()
    sparkConf.setAppName("HiveContextApp").setMaster("local[*]")


    val sc = new SparkContext(sparkConf)
    val hiveContext = new HiveContext(sc)

    //2）相关的处理
    hiveContext.table("student").show()
    //3）关闭资源
    sc.stop()
  }
}
